<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>图片管理</title>
<script type="text/javascript" src="Public/js/jquery-1.7.js"></script>
<link href="Public/js/Portfolio/css/screen.css" type="text/css" rel="stylesheet" media="screen,projection" />
<script type="text/javascript" src="Public/js/Portfolio/js/framework.js"></script>

<script type="text/javascript" src="Public/js/lightbox/js/jquery.lightbox-0.4.js"></script>
    <link rel="stylesheet" type="text/css" href="Public/js/lightbox/css/jquery.lightbox-0.4.css" media="screen" />
<script type="text/javascript" src="Public/js/jspopup/popup.js"></script>
<script type="text/javascript" src="Public/js/user.js"></script>
 <literal>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
	 $('#portfolio a').lightBox();
	$("#addImage").bind("click",function(){
		//添加图片时 必须选择一个分类
		var gid=[];
		$("input[name^='imagegroup']:checked").each(function(){
			gid.push($(this).val());
		});
		if(gid.length<1){
			pAlertN("信息提示","请先选择分类或添加分类后再上传图片");
			return false;
		}
		addImageDialog(gid.join(','));
	});
	$("#addGroup").bind("click",function(){
		addGroupDialog();
	});
	$("#delGroup").bind("click",function(){
		delGroup();
	});
	$("#editGroup").bind("click",function(){
		
		var gid=[];
		$("input[name^='imagegroup']:checked").each(function(){
			gid.push($(this).val());
		});
		if(gid.length<1){
			pAlertN("信息提示","请先选择需要编辑的分类");
			return false;
		}else if(gid.length>1){
			pAlertN("信息提示","只能对一个分类进行编辑");
			return false;
		}
		editGroup(gid.join(','));
	});
} );
function addImageDialog(gid){
	var url="?m=Admin&a=imageAdd&g_id="+gid;
	pDialog("上传图片",url,450,358);
}
function addGroupDialog(){
	var url="?m=Admin&a=groupAdd";
	pDialog("添加图片分类",url);
}
function editGroup(id){
	var url="?m=Admin&a=groupEdit&g_id="+id;
	pDialog("编辑图片分类",url);
}
function delImage(id){
	pConfirm("信息提示","确认要删除？",id);
	
}
function ShowCallBack(para){
	var pid=para["pid"];
	$.ajax({
		   type: "GET",
		   url: "?m=Admin&a=imageDel",
		   data: "pid="+encodeURIComponent(pid),
		   success: function(msg){
		     var _ok=parseInt(msg);
		     if(_ok>=1){
		    	 window.location.reload(); 
		     }else{
		    	 pAlertN("信息提示","删除失败");
		     }
		   }
		}); 
}
function delGroup(){
	if(window.confirm("确认要删除？")){
		var gid=[];
		$("input[name^='imagegroup']:checked").each(function(){
			gid.push($(this).val());
		});
		if(gid.length<1){
			pAlertN("信息提示","请选择需要删除的图片分类");
			return false;
		}
		var gid=gid.join(',');
		$.ajax({
			   type: "GET",
			   url: "?m=Admin&a=groupDel",
			   data: "gid="+encodeURIComponent(gid),
			   success: function(msg){
			     var _ok=parseInt(msg);
			     if(_ok>=1){
			    	 window.location.reload(); 
			     }else{
			    	 pAlertN("信息提示","删除失败");
			     }
			   }
			}); 
	}
	
	//alert(gid);
}
</script>
</literal>
<style>
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
	font-size: 12;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
.full_width table{
	font-size: 12px;
	text-align:center;
}
.full_width div{
	font-size: 12px;
}
#container1{
	height:20px;
}
	/* jQuery lightBox plugin - Gallery style */
	#portfolio {
		background-color: #444;
		padding: 10px;
		width: 520px;
	}
	#portfolio ul { list-style: none; }
	#portfolio ul li { display: ''; }
	#portfolio ul img {
		border: 5px solid #3e3e3e;
		border-width: 5px 5px 20px;
	}
	#portfolio ul a:hover img {
		border: 5px solid #fff;
		border-width: 5px 5px 20px;
		color: #fff;
	}
	#portfolio ul a:hover { color: #FFF; }
-->
</style>
</head>
<body >
<div id="container1" >
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="Public/tpl-default/images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 图片信息信息列表</span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="STYLE1">
              <span id="addGroup" ><img src="Public/tpl-default/images/add.gif" width="10" height="10"  /> <span style="cursor:pointer">添加分类</span></span>  &nbsp;  &nbsp;<span id="editGroup"><img src="Public/tpl-default/images/edit.gif" width="10" height="10" /> <span style="cursor:pointer">编辑分类 </span> </span>&nbsp;&nbsp; <span id="delGroup"><img src="Public/tpl-default/images/del.gif" width="10" height="10" /> <span style="cursor:pointer">删除分类 </span> </span>&nbsp;&nbsp;<span id="addImage" ><img src="Public/tpl-default/images/add.gif" width="10" height="10"  /> <span style="cursor:pointer">上传图片</span></span>   &nbsp; <!--  <img src="Public/tpl-default/images/del.gif" width="10" height="10" /> <span style="cursor:pointer">删除 </span>   &nbsp;&nbsp;<img src="Public/tpl-default/images/edit.gif" width="10" height="10"  /> <span style="cursor:pointer">编辑   </span>&nbsp;</span>--><span class="STYLE1"> &nbsp;</span></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  </table>
</div>
<div id="container">
		<ul id="filter">
			<li>图片分类:</li>
			<volist name="data" id="vo">
				<li ><input type="checkbox" id="labelGroup_{$vo['g_id']}" name="imagegroup[]" value="{$vo['g_id']}" /><a href="#">{$vo["g_name_cn"]}</a></li>
			</volist>
		</ul>
		<ul id="portfolio">
			<volist name="imageData" id="vo">
			<li class="{$vo['g_name']}"><a title="{$vo['img_name']}" href="{$vo['img_url']}"><img src="{$vo['img_url']}" alt="" height="115" width="200" />{$vo['img_name']}</a><span style="cursor:pointer;color:#fff"  onclick="delImage({$vo['pid']})">[删除]</span></li>
			</volist>
		</ul>
</div>
</body>
</html>